home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / PAS_0493 / CAPONOFF.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-22  |  1KB  |  33 lines

  1. {─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
  2. Msg  : 289 of 354
  3. From : David Drzyzga                       1:3612/220.0         14 Apr 93  16:42
  4. To   : Ian Nordby                          1:101/106.0
  5. Subj : Help?
  6. ────────────────────────────────────────────────────────────────────────────────
  7.  IN>         I'm hoping someone out there might be able to
  8.  IN> assist me...  I working on a project in Turbo and I'm
  9.  IN> looking for a way to toggle the keyboard CAPS LOCK
  10.  IN> status from within the program -- presumably with some
  11.  IN> INLINE code or an interrupt or something (neither of
  12.  IN> which I know anything about -- I'm not what you'd call
  13.  IN> a very "advanced" programmer).  If anyone has some
  14.  IN> ideas towards this end that they wouldn't mind sharing,
  15.  
  16. Here's how you do just that!: }
  17.  
  18. Program CapsONandOFF;
  19.  
  20. const
  21.   CapsLockOn   = $40;
  22.   {and for an added bonus here's some more values to use:}
  23.   InsertOn     = $80;
  24.   NumLockOn    = $20;
  25.   ScrollLockOn = $10;
  26.  
  27. var
  28.   KeyFlag : byte absolute $0040:$0017;
  29. Begin
  30.   KeyFlag := KeyFlag or CapsLockOn;
  31.   readln;
  32.   KeyFlag := KeyFlag and (not CapsLockOn);
  33. End.